package besta.moon.sql.expression.function.numeric;

import besta.moon.sql.expression.function.FunctionReturnFloat;
import besta.moon.sql.parser.SQLTokenizer;

public final class FunctionCot extends FunctionReturnFloat {

    @Override
    public final int getFunction() {
        return SQLTokenizer.COT;
    }

    @Override
    public final double getDouble() throws Exception {
        if (isNull()) {
            return 0;
        }
        return 1 / Math.tan(param1.getDouble());
    }
}
